package come.whvc

object Test7{
  def main(args: Array[String]): Unit = {
    val words = List("apple", "banana", "cherry", "date", "elderberry")

    val longWords = words.filter(_.length > 5)
    val upperCaseWords = words.map(_.toUpperCase)
    val wordLengths = words.map(_.length)
    val wordsWithA = words.filter(_.contains('a'))

    println("长度大于5的单词：" + longWords)
    println("所有单词转换为大写：" + upperCaseWords)
    println("每个单词的长度：" + wordLengths)
    println("包含字母'a'的单词：" + wordsWithA)
  }
}
